const ScenicSpot = require('../../model/scenicSpot/ScenicSpot')

function change(req,res){
  console.log(req.body)
  ScenicSpot.findByIdAndUpdate(req.body.id, {
    scenicSpotName: req.body.scenicSpotName,
    scenicSpotPrice: req.body.scenicSpotPrice,
    scenicSpotDesc: req.body.scenicSpotDesc,
    startTime: req.body.startTime,
    endTime: req.body.endTime,
    imgSrc: req.body.imgSrc,
    typeArr: req.body.typeArr

  }, function(err,result){
    if (err) {
        res.json({
            code:0,
            msg: '更新失败'
        })
    }else{
        res.json({
            code:1,
            msg: '更新成功'
        })
    }
  })


  
}
module.exports = change